#include"bits/stdc++.h"
using namespace std;
int sw[1000000],g;
bool number_is_number_of_palindromes(int number)
{
	memset(sw,0,sizeof(sw));
	int number_2=0,number_1;
	number_1=number;
	while(number)
	{
		g+=1;
		sw[g]=number%10;
		number/=10;
	}
	for(int i=1;i<=g;i++)
	{
		number_2*=10;
		number_2+=sw[i];
	}
	return number_1==number_2;
}
int main()
{
	int a,b;
	cin>>a>>b;
	for(int i=a;i<=b;i++)
	{
		if(number_is_number_of_palindromes(i))
		{
			cout<<i<<" ";
		}
	}
}  
